package com.demo.base.security;

import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * Created by 郭良艺 on 2017/4/12.
 */
public class CustomAuthenticationProvider extends DaoAuthenticationProvider {

    public void setUserDetailsService(UserDetailsService userDetailsService) {
        super.setUserDetailsService(userDetailsService);
    }

    @Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        //千万要调用父类的方法，否则永远不会跳入用户合法处理逻辑
        return super.authenticate(authentication);
    }
}
